package com.moleq.mgpos.widget;

import com.moleq.base.SmartBeep;

import android.content.Context;
import android.util.AttributeSet;
import android.util.Log;
import android.view.MotionEvent;
import android.widget.ImageButton;

public class BeepImageButton extends ImageButton {
	
	private static final String TAG = "BeepImageButton";
	private Context mContext;
	
	public BeepImageButton(Context context) {
		super(context);
		init(context);
	}

	public BeepImageButton(Context context, AttributeSet attrs) {
		super(context, attrs);
		init(context);
	}

	public BeepImageButton(Context context, AttributeSet attrs, int defStyle) {
		super(context, attrs, defStyle);
		init(context);
	}
	
	private void init(Context context) {
		mContext = context;
	}

	@Override
	public boolean onTouchEvent(MotionEvent event) {

		if (event.getAction() == MotionEvent.ACTION_DOWN) {
			SmartBeep.getInstance().play(SmartBeep.SOUND_CLICK);   
		}

		return super.onTouchEvent(event);
	}
}
